package com.hxd.otc.common.enums;

import android.text.TextUtils;

/**
 * Created by lzy on 2018/12/5 0005.
 * description ${境内外}
 */
public enum CountryCodeEnum {
    CHINA("00", "境内"), OTHER("01", "境外"), ERROR("-1", "无");

    private final String mValue;
    private final String mDesc;

    CountryCodeEnum(String value, String desc) {
        mValue = value;
        mDesc = desc;
    }

    public String getValue() {
        return mValue;
    }

    public String getDesc() {
        return mDesc;
    }

    public static CountryCodeEnum getInstance(String value) {
        if (TextUtils.isEmpty(value)) return ERROR;
        switch (value) {
            case "00":
                return CHINA;
            case "01":
                return OTHER;
            default:
                return ERROR;
        }
    }
}
